<%@ Control Language="C#" ClassName="ContractConditions_PTIByGrossIncome" Inherits="Dimok.Web.UI.TableControl" %>
<%@ Import Namespace="System.ComponentModel" %>
<script runat="server">
	[Bindable(true)]
	public string ContractConditionCode { set { ds.ContractConditionCode = value; } }
	protected override void OnInit(EventArgs e) {
		base.OnInit(e);
		grv.RowInserting += new EventHandler<GridViewInsertEventArgs>(grv_RowInserting);
	}

	void grv_RowInserting(object sender, GridViewInsertEventArgs e) {
		e.InsertingValues["ContractConditionCode"] = ds.ContractConditionCode;
	}
</script>

<table>
<tr><td>
<ajaxtk:CollapsiblePanelExtender runat="server"
	TargetControlID="pnlCBT"
	CollapseControlID="pnlCBTHeader" ExpandControlID="pnlCBTHeader"
	TextLabelID="lblCBTLabel"
	ImageControlID="imgCBTPanel"
	CollapsedImage="~/images/Buttons/expand.jpg" ExpandedImage="~/images/Buttons/collapse.jpg"
	Collapsed="true"	CollapsedText="" ExpandedText=""
	SuppressPostBack="true"
></ajaxtk:CollapsiblePanelExtender>
<asp:Panel ID="pnlCBTHeader" CssClass="PanelHeaderBlue" style="width:100%" runat="server">
<table cellPadding="0" cellSpacing="0"><tr>
<th Width="1px"><asp:Image ID="imgCBTPanel" ImageUrl="~/images/Buttons/expand.jpg" runat="server" />
<td nowrap><label ID="lblCBTLabel" runat="server">PTI By Gross Income</label></td>
</tr></table>
</asp:Panel> 
<asp:Panel ID="pnlCBT" runat="server" CssClass="PannelContent">

<asp:UpdatePanel ID="up" UpdateMode="Always" runat="server">
	<ContentTemplate>
		<UI:GridViewEx ID="grv" runat="server" AutoGenerateColumns="False" DataSourceID="ds"
			ShowFooter="True" AllowSorting="True" 
			DataKeyNames="ID"
			>
			<Columns>

		<asp:TemplateField HeaderText="Code" SortExpression="ContractConditionCode">
			<ItemTemplate><%#Eval("ContractConditionCode")%></ItemTemplate>
		</asp:TemplateField>

		<asp:TemplateField HeaderText="Income From" SortExpression="GrossIncomeFrom">
			<ItemStyle HorizontalAlign="Right" />
			<ItemTemplate><%#Eval("GrossIncomeFrom","{0:c0}")%></ItemTemplate>
			<EditItemTemplate><asp:TextBox ID="txtGrossIncomeFrom" Text='<%#Bind("GrossIncomeFrom")%>' runat="server" /></EditItemTemplate>
			<FooterTemplate><asp:TextBox ID="GrossIncomeFrom" runat="server" /></FooterTemplate>
		</asp:TemplateField>

		<asp:TemplateField HeaderText="Income To" SortExpression="GrossIncomeTo">
			<ItemStyle HorizontalAlign="Right" />
			<ItemTemplate><%#Eval("GrossIncomeTo", "{0:c0}")%></ItemTemplate>
			<EditItemTemplate><asp:TextBox ID="txtGrossIncomeTo" Text='<%#Bind("GrossIncomeTo")%>' runat="server" /></EditItemTemplate>
			<FooterTemplate><asp:TextBox ID="GrossIncomeTo" runat="server" /></FooterTemplate>
		</asp:TemplateField>

		<asp:TemplateField HeaderText="PTI" SortExpression="PTI">
			<ItemTemplate><%#Eval("PTI")+"%"%></ItemTemplate>
			<EditItemTemplate><asp:TextBox ID="txtPTI" Text='<%#Bind("PTI")%>' runat="server" /></EditItemTemplate>
			<FooterTemplate><asp:TextBox ID="PTI" runat="server" /></FooterTemplate>
		</asp:TemplateField>

			</Columns>
		</UI:GridViewEx>
	</ContentTemplate>
</asp:UpdatePanel>

</asp:Panel>
</table>
<DS:ContractCondition_PTIByGrossIncomeDataSource ID="ds" runat="server" />
